package com.report.reportserver.service.impl;

import com.report.reportserver.mapper.UserMapper;
import com.report.reportserver.mapper.UserRoleMapper;
import com.report.reportserver.model.User;
import com.report.reportserver.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ ClassName: UserServiceImpl
 * @ Description：
 * @ Modified By：
 * @ Version:
 * @ Author     ：LiYing
 * @ Date       ：Created in 16:19 2022/2/27
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Autowired
    UserRoleMapper userRoleMapper;
    @Override
    public User queryUserById(Integer id) {
        User user = userMapper.selectByPrimaryKey(id);
        return user;
    }

    @Override
    public User queryUserByName(String name) {
        User user = userMapper.selectByName(name);
        return user;
    }

    @Override
    public Integer queryRoleByName(String name) {
        return userRoleMapper.selectRoleByName(name);
    }
}
